package com.thornbird.vehiclerecycling.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(
        name = "orders",
        indexes = {
                @Index(columnList = "serialNumber"),
                @Index(columnList = "certificateNumber"),
                @Index(columnList = "companyName"),
                @Index(columnList = "ownerName"),
                @Index(columnList = "idNumber"),
                @Index(columnList = "phoneNumber"),
                @Index(columnList = "registrationDate"),
                @Index(columnList = "cancellationDate"),
                @Index(columnList = "vehicleNumber"),
                @Index(columnList = "userId")
        }
)
public class Order extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -2933137285328704014L;

    // 流水号
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String serialNumber;

    // 回收证明编号
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String certificateNumber;

    // 回收企业名称
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String companyName;

    // 车主名称
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String ownerName;

    // 车主身份证号/代码证号
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String idNumber;

    // 车主联系电话
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String phoneNumber;

    // 车主地址
    @Column(columnDefinition = "varchar(200)", nullable = false)
    private String address;

    // 交车日期
    @Column(columnDefinition = "timestamp(6)", nullable = false)
    private Date deliveryDate;

    // 注册登记日期
    @Column(columnDefinition = "timestamp(6)", nullable = false)
    private Date registrationDate;

    // 车辆牌照号码
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleNumber;

    // 车辆类型
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleType;

    // 车辆使用性质
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleNature;

    // 车辆品牌
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleBrand;

    // 车辆型号
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleModel;

    // 车辆识别代号
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vin;

    // 整备质量
    @Column(columnDefinition = "int4", nullable = true)
    private Integer weight;

    // 动力类别
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String powerType;

    // 发动机号码
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String engineNumber;

    // 动力电池编码
    @Column(columnDefinition = "varchar(50)", nullable = true)
    private String batteryNumber;

    // 经办人
    @Column(columnDefinition = "varchar(50)", nullable = true)
    private String operator;

    // 办理日期
    @Column(columnDefinition = "timestamp(6)", nullable = false)
    private Date processingDate;

    // 说明
    @Column(columnDefinition = "varchar(255)", nullable = true)
    private String remark;

    // 注销日期
    @Column(columnDefinition = "timestamp(6)", nullable = false)
    private Date cancellationDate;

    // 车管所
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String vehicleManagementOffice;

    // 已收回
    @Column(columnDefinition = "varchar(255)", nullable = true)
    private String recoveredMaterials;

    // 未收回
    @Column(columnDefinition = "varchar(255)", nullable = true)
    private String unrevokedMaterials;

    // 校验码
    @Column(columnDefinition = "varchar(50)", nullable = true)
    private String checkCode;

    // 已作废
    @Column(columnDefinition = "bool", nullable = false)
    private Boolean deleted;

    // 用户ID
    @Column(columnDefinition = "int8", nullable = false)
    private Long userId;

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getCertificateNumber() {
        return certificateNumber;
    }

    public void setCertificateNumber(String certificateNumber) {
        this.certificateNumber = certificateNumber;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public Date getRegistrationDate() {
        return registrationDate;
    }

    public void setRegistrationDate(Date registrationDate) {
        this.registrationDate = registrationDate;
    }

    public String getVehicleNumber() {
        return vehicleNumber;
    }

    public void setVehicleNumber(String vehicleNumber) {
        this.vehicleNumber = vehicleNumber;
    }

    public String getVehicleType() {
        return vehicleType;
    }

    public void setVehicleType(String vehicleType) {
        this.vehicleType = vehicleType;
    }

    public String getVehicleNature() {
        return vehicleNature;
    }

    public void setVehicleNature(String vehicleNature) {
        this.vehicleNature = vehicleNature;
    }

    public String getVehicleBrand() {
        return vehicleBrand;
    }

    public void setVehicleBrand(String vehicleBrand) {
        this.vehicleBrand = vehicleBrand;
    }

    public String getVehicleModel() {
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel) {
        this.vehicleModel = vehicleModel;
    }

    public String getVin() {
        return vin;
    }

    public void setVin(String vin) {
        this.vin = vin;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public String getPowerType() {
        return powerType;
    }

    public void setPowerType(String powerType) {
        this.powerType = powerType;
    }

    public String getEngineNumber() {
        return engineNumber;
    }

    public void setEngineNumber(String engineNumber) {
        this.engineNumber = engineNumber;
    }

    public String getBatteryNumber() {
        return batteryNumber;
    }

    public void setBatteryNumber(String batteryNumber) {
        this.batteryNumber = batteryNumber;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public Date getProcessingDate() {
        return processingDate;
    }

    public void setProcessingDate(Date processingDate) {
        this.processingDate = processingDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCancellationDate() {
        return cancellationDate;
    }

    public void setCancellationDate(Date cancellationDate) {
        this.cancellationDate = cancellationDate;
    }

    public String getVehicleManagementOffice() {
        return vehicleManagementOffice;
    }

    public void setVehicleManagementOffice(String vehicleManagementOffice) {
        this.vehicleManagementOffice = vehicleManagementOffice;
    }

    public String getRecoveredMaterials() {
        return recoveredMaterials;
    }

    public void setRecoveredMaterials(String recoveredMaterials) {
        this.recoveredMaterials = recoveredMaterials;
    }

    public String getUnrevokedMaterials() {
        return unrevokedMaterials;
    }

    public void setUnrevokedMaterials(String unrevokedMaterials) {
        this.unrevokedMaterials = unrevokedMaterials;
    }

    public String getCheckCode() {
        return checkCode;
    }

    public void setCheckCode(String checkCode) {
        this.checkCode = checkCode;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

}
